package com.jty.lib_base.room.dao

import androidx.room.*
import com.jty.lib_base.room.bean.ResearchItem


/**
 * author: zhouyh
 * created on: 2022/3/22 9:33 上午
 * description:教研活动数据库
 */
@Dao
interface ResearchItemDao {

    @Query("SELECT * FROM research_note")
    fun getAll() : List<ResearchItem>

    @Query("SELECT * FROM research_note WHERE research_id = (:researchId) LIMIT 1")
    fun getResearchItemById(researchId : String):ResearchItem

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insertResearchItem(vararg researchItem: ResearchItem)

    @Delete
    fun delete(researchItem: ResearchItem)

    @Update
    fun updateResearchItem(vararg  researchItem: ResearchItem)

}